import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:wallet_utils/color.dart';
import 'package:wallet_utils/ht_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:wallet_utils/text_style.dart';
import 'logic.dart';

class AuditProgressPage extends StatelessWidget {
  final logic = Get.put(AuditProgressLogic());
  final state = Get.find<AuditProgressLogic>().state;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: htCommonAppbar(context, title: ''),
      body: GetBuilder<AuditProgressLogic>(builder: (logic) {
        return Column(
          children: [
            Stack(
              alignment: Alignment.center,
              children: [
                Container(
                    margin: EdgeInsets.only(top: 52.w, bottom: 54.w),
                    child: Image.asset(
                      'images/icon_loading.png',
                      width: 192.w,
                      height: 192.w,
                    )),
                Container(
                  //限制进度条的高度
                  height: 192.0,
                  //限制进度条的宽度
                  width: 192,
                  child: CircularProgressIndicator(
                      //0~1的浮点数，用来表示进度多少;如果 value 为 null 或空，则显示一个动画，否则显示一个定值
                      value: logic.animation.value,
                      //背景颜色
                      backgroundColor: Colors.transparent,
                      //进度颜色
                      valueColor: AlwaysStoppedAnimation<Color>(ColorManager.color1774FF)),
                ),
                Container(
                    margin: EdgeInsets.only(top: 75.w),
                    child: Text(
                      '${((logic.animation.value) * 100).toInt()}%',
                      style: TextStyleUtils.style000000(fontSize: 14.sp),
                    ))
              ],
            ),
            Container(
              margin: EdgeInsets.symmetric(horizontal: 50.w),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Text(
                    '身份信息确认',
                    style: state.isAuditOne
                        ? TextStyleUtils.style000000(fontSize: 16.sp)
                        : TextStyleUtils.colorBABDD0(fontSize: 16.sp),
                  ),
                  Image.asset(
                    state.isAuditOne ? 'images/icon_check.png' : 'images/icon_uncheck.png',
                    width: 18.w,
                    height: 17.w,
                  ),
                ],
              ),
            ),
            Container(
              margin: EdgeInsets.symmetric(vertical: 25.w, horizontal: 50.w),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Text(
                    '正在提交资料',
                    style: state.isAuditTwo
                        ? TextStyleUtils.style000000(fontSize: 16.sp)
                        : TextStyleUtils.colorBABDD0(fontSize: 16.sp),
                  ),
                  Image.asset(
                    state.isAuditTwo ? 'images/icon_check.png' : 'images/icon_uncheck.png',
                    width: 18.w,
                    height: 17.w,
                  ),
                ],
              ),
            ),
            Container(
              margin: EdgeInsets.symmetric(horizontal: 50.w),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Text(
                    '正在进行初审',
                    style: state.isAuditThree
                        ? TextStyleUtils.style000000(fontSize: 16.sp)
                        : TextStyleUtils.colorBABDD0(fontSize: 16.sp),
                  ),
                  Image.asset(
                    state.isAuditThree ? 'images/icon_check.png' : 'images/icon_uncheck.png',
                    width: 18.w,
                    height: 17.w,
                  ),
                ],
              ),
            ),
          ],
        );
      }),
    );
  }
}
